<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Api\ApiController;
use App\Http\Controllers\Api\ProductController;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

// Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
//     return $request->user();
// });

Route::group(['namespace'=>'Api','prefix'=>'api','middleware'=>'api'],function (){
    // //首页
    // Route::get('teacherUp', [ApiController::class, 'teacherUp']);
    Route::any('openid', [ApiController::class, 'openid'])->name('api.openid');
    Route::any('updateUserinfo', [ApiController::class, 'updateUserinfo'])->name('api.updateUserinfo');
    Route::any('courseUp', [ApiController::class, 'courseUp'])->name('api.courseUp');
    Route::any('incomeUp', [ApiController::class, 'incomeUp'])->name('api.incomeUp');
    Route::any('codeIn', [ApiController::class, 'codeIn'])->name('api.codeIn');
    Route::any('codePage', [ApiController::class, 'codePage'])->name('api.codePage');
    Route::any('dataIn', [ApiController::class, 'dataIn'])->name('api.dataIn');

    // //老师
    // Route::any('teachers/{page?}', 'TeacherController@teachers')->name('api.teachers');
    // Route::any('teacherSearch', 'TeacherController@teacherSearch')->name('api.teacherSearch');

    // Route::any('teacherIntro', 'TeacherController@teacherIntro')->name('api.teacherIntro');

    //课程
    Route::any('pageCourses', [ProductController::class, 'pageCourses'])->name('api.pageCourses');
    Route::any('courseDetail', [ProductController::class, 'courseDetail'])->name('api.courseDetail');
    // Route::any('products', [ProductController::class, 'courseUp'])->name('api.products');
    // Route::any('productSearch', 'ProductController@productSearch')->name('api.productSearch');
    // Route::any('evaluation', 'ProductController@evaluation')->name('api.evaluation');
    // Route::any('productDetail', [ProductController::class, 'productDetail'])->name('api.productDetail');

    //收藏
    Route::any('collect', 'CollectController@collect')->name('api.collect');

    //收藏
    Route::any('evaluate', 'EvaluateController@evaluate')->name('api.evaluate');
});